package cn.smxy.search.controller;

import cn.smxy.param.PlantSearchParam;
import cn.smxy.search.service.SearchService;
import cn.smxy.util.R;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/search")
public class SearchController {
    @Autowired
    private SearchService searchService;

    /**
     * 植物搜索接口
     * @param plantSearchParam
     * @return
     */
    @PostMapping("/plant")
    public R plantList(@RequestBody PlantSearchParam plantSearchParam) throws JsonProcessingException {
        return searchService.plantList(plantSearchParam);
    }

}
